#include <string.h>
#include "ObstacleFactory.h"
#include "ObstacleFactoryImpl.h"
#include "obstacles/Ball.h"
#include "obstacles/Box.h"
Obstacle * ObstacleFactoryImpl::create(const char* name) {
if (strcmp(name,"Ball") == 0) { return new obstacles::Ball;} if (strcmp(name,"Box") == 0) { return new obstacles::Box;}
}
char * ObstacleFactoryImpl::getAvailableObstacles() {
const char* names = ",Ball,Box";
char *retnames = new char[strlen(names)+1];
strcpy(retnames, names);
return retnames;
}
